<template>
  <div class="position-r swiper-box">
    <Swiper class="box" :options="options" ref="swiper">
      <SwiperSlide
        class="img_box"
        v-for="(item, index) in carouselList"
        :key="index"
      >
        <img
          style="width: 100%; min-height: 700px;"
          :data-index="index"
          :src="item.pic"
          alt=""
          :index="index"
        />
      </SwiperSlide>
      <!-- 分页器 -->
      <div slot="pagination" class="swiper-pagination"></div>
    </Swiper>
  </div>
</template>
<script>
import { Swiper, SwiperSlide } from 'vue-awesome-swiper'
export default {
  components: {
    Swiper,
    SwiperSlide,
  },
  data() {
    return {
      carouselList: [
        {
          pic:
            'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
        },
        {
          pic:
            'https://fuss10.elemecdn.com/1/34/19aa98b1fcb2781c4fba33d850549jpeg.jpeg',
        },
        {
          pic:
            'https://fuss10.elemecdn.com/2/11/6535bcfb26e4c79b48ddde44f4b6fjpeg.jpeg',
        },
      ],
      options: {
        initialSlide: 0,
        //自动轮播图
        autoplay: {
          // delay: 100000,
          delay: 5000,
          stopOnLastSlide: false,
          disableOnInteraction: true,
        },
        //无缝衔接
        loop: true,
        //分页器配置项
        pagination: {
          el: '.swiper-pagination',
          clickable: true, // 点击分页器小球进行轮播图切换
          bulletClass: 'swiper-pagination-bullet',
        },
      },
    }
  },
}
</script>
<style lang="scss">
.swiper-box {
  .swiper-pagination-bullet {
    background: #fff;
  }
}
.img_box {
  height: 550px;
}
</style>
